package com.ican.dao.user;

import java.util.Date;

import org.springframework.stereotype.Repository;

import com.ican.common.hibernate.HibernateDao;
import com.ican.domain.user.UserResources;

@Repository("userResourcesDao")
public class UserResourcesDao extends HibernateDao<UserResources, Integer> {
    
    public void addUserResources(UserResources us){
        us.setCreateTime(new Date());
        this.save(us);
    }
    
    public void removeUserResources(UserResources us){
        String hql = "delete from UserResources where userId = ? and resourcesId = ?";
        batchExecute(hql, new Object[]{us.getUserId(), us.getResourcesId()});
    }
}
